package jp.go.aist.six.test.vuln.core.scap.nvd;

import jp.go.aist.six.util.IsoDate;
import jp.go.aist.six.util.search.LikeBinding;
import jp.go.aist.six.util.search.RelationalBinding;
import org.testng.annotations.DataProvider;
import java.util.Date;




/**
 * @author  Akihito Nakamura, AIST
 * @version $Id: NvdServiceTestBase.java 193 2010-06-01 01:18:22Z nakamura5akihito $
 */
public class NvdServiceTestBase
{

    /**
     */
    public NvdServiceTestBase()
    {
    }



    //**************************************************************
    //  Nvd
    //**************************************************************

    /**
     * Sample NVD vulnerability criteria.
     */
    @DataProvider( name="nvd-vulnerability-filter" )
    public Object[][] nvdVulnerabilityCriteriaProvider()
    {
        Date  timestamp = IsoDate.valueOf( "2010-01-01T12:30:00" );

        return new Object[][] {
                        {
                            RelationalBinding.greaterEqualBinding( "cvss.baseMetrics.score", "9.0" )
                        }
                        ,
                        {
                            RelationalBinding.greaterThanBinding( "publishedDatetime", timestamp )
                        }
                        ,
                        {
                            new LikeBinding( "vulnerableSoftwareList.product.name", "cpe:/a:microsoft:internet_explorer:%" )
                        }
                        ,
                        {
                            null
                        }
        };
    }



    /**
     * Sample NVD XML Feed.
     */
    @DataProvider( name="nvd-xml-feed" )
    public Object[][] nvdXmlFeedProvider()
    {
        return new Object[][] {
                        {
                            "test/data/nvd/20100516_nvdcve-2.0-2010.xml"
                        }
        };
    }



    /**
     * Sample NVD XML.
     */
    @DataProvider( name="nvd-xml" )
    public Object[][] nvdXmlProvider()
    {
        return new Object[][] {
                        {
                            "test/data/nvd/nvdcve-2.0-2010_CVE-2010-0249.xml",
                            "2.0",
                            new String[] { "CVE-2010-0249" }
                        }
                        ,
                        {
                            "test/data/nvd/nvdcve-2.0-2006_CVE-2006-0021.xml",
                            "2.0",
                            new String[] { "CVE-2006-0021" }
                        }
        };
    }

}
// NvdServiceTestBase

/* vim:set tabstop=4:set expandtab:set shiftwidth=4: */

